
<script type="text/javascript">
    $(document).ready(function() {
        $('#searchMovie').tableFilter();
        $('#searchActor').tableFilter();
    });
</script>

<table>
    <tr>
        <td style="vertical-align: text-top;">
            <table id='searchMovie' class="update">
                <thead>
                    <tr>
                        <th>Search Movie</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($this->moviesUpdate as $movie) { ?>
                        <tr>
                            <td>
                                <h1><?php echo $movie["Title"]; ?>
                                    <img src="<?php echo $this->baseUrl; ?>/img/esrb/<?php echo $movie["ESRB"]; ?>.gif" style="vertical-align: middle; height: 30px; " />
                                </h1>
                                Running Time: <b><?php echo $movie["RunningTime"]; ?> min </b>
                                Release Date: <b><?php echo date("m/d/Y", strtotime($movie["D_Release"])); ?></b>
                                <br />
                                <i>"<?php echo substr($movie["Description"], 0, 100); ?> [..]"</i>
                                <br />
                                <img src="<?php echo $this->baseUrl; ?>/posters/<?php echo $movie["Poster"] ?>" style="max-width: 200px; max-height: 100px;" alt="NO POSTER" />
                                <br />
                                <b>Actors : </b>
                                <?php 
                                	$moviehasactorDB = new Application_Model_MoviehasActor;
                                	$actors = $moviehasactorDB->getActors($movie["Movie_ID"]);
                                	foreach ($actors as $actor) { 
                                		echo $actor["Name"]." / ";
                                	}
                                ?>
                                <br />
                                <a href="<?php echo $this->baseUrl; ?>/Administration/updatemovie/id/<?php echo $movie["Movie_ID"] ?>">Update</a> -
                                <a href="<?php echo $this->baseUrl; ?>/Administration/index/form/4/id/<?php echo $movie["Movie_ID"] ?>">Delete</a>
                                <hr />
                            </td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
        </td>
        <td  style="vertical-align: text-top;">

            <table id='searchActor' class="update">
                <thead>
                    <tr>
                        <th>Search Actor</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($this->actorsUpdate as $actor) { ?>
                        <tr>
                            <td>
                                <h1><?php echo $actor["Name"]; ?> 
                                    (<?php
                    echo substr($actor["Birthday"], 4, 2) . "-"
                    . substr($actor["Birthday"], 6, 2) . "-"
                    . substr($actor["Birthday"], 0, 4);
                        ?>)
                                </h1>
                                <img src="<?php echo $this->baseUrl; ?>/pictures/<?php echo $actor["Picture"]; ?>" alt="No picture" style="max-height: 100px; max-width: 200px;">
                                <br />
                                <a href="<?php echo $this->baseUrl; ?>/Administration/updateactor/id/<?php echo $actor["Actor_ID"] ?>">Update</a> -
                                <a href="<?php echo $this->baseUrl; ?>/Administration/index/form/5/id/<?php echo $actor["Actor_ID"] ?>">Delete</a>
                                <hr />
                            </td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>

        </td>
    </tr>
</table>




